.class public Lcom/adview/adapters/ZestADZAdapter;
.super Lcom/adview/adapters/AdViewAdapter;
.source "ZestADZAdapter.java"

# interfaces
.implements Lcom/zestadz/android/ZestADZAdView$ZestADZListener;


# direct methods
.method public constructor <init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V
    .locals 0
    .parameter "adViewLayout"
    .parameter "ration"

    .prologue
    .line 19
    invoke-direct {p0, p1, p2}, Lcom/adview/adapters/AdViewAdapter;-><init>(Lcom/adview/AdViewLayout;Lcom/adview/obj/Ration;)V

    .line 21
    return-void
.end method


# virtual methods
.method public AdFailed(Lcom/zestadz/android/ZestADZAdView;)V
    .locals 3
    .parameter "arg0"

    .prologue
    .line 57
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 58
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "ZestADZ fail"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 59
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/zestadz/android/ZestADZAdView;->setListener(Lcom/zestadz/android/ZestADZAdView$ZestADZListener;)V

    .line 60
    iget-object v1, p0, Lcom/adview/adapters/ZestADZAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 61
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 66
    :goto_0
    return-void

    .line 64
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover_pri()V

    .line 65
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedPri()V

    goto :goto_0
.end method

.method public AdReturned(Lcom/zestadz/android/ZestADZAdView;)V
    .locals 3
    .parameter "arg0"

    .prologue
    .line 71
    invoke-static {}, Lcom/adview/AdViewTargeting;->getRunMode()Lcom/adview/AdViewTargeting$RunMode;

    move-result-object v1

    sget-object v2, Lcom/adview/AdViewTargeting$RunMode;->TEST:Lcom/adview/AdViewTargeting$RunMode;

    if-ne v1, v2, :cond_0

    .line 72
    const-string v1, "AdView SDK v1.7.0"

    const-string v2, "ZestADZ success"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 73
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/zestadz/android/ZestADZAdView;->setListener(Lcom/zestadz/android/ZestADZAdView$ZestADZListener;)V

    .line 74
    iget-object v1, p0, Lcom/adview/adapters/ZestADZAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v1}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adview/AdViewLayout;

    .line 75
    .local v0, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v0, :cond_1

    .line 82
    :goto_0
    return-void

    .line 78
    :cond_1
    iget-object v1, v0, Lcom/adview/AdViewLayout;->adViewManager:Lcom/adview/AdViewManager;

    invoke-virtual {v1}, Lcom/adview/AdViewManager;->resetRollover()V

    .line 79
    iget-object v1, v0, Lcom/adview/AdViewLayout;->handler:Landroid/os/Handler;

    new-instance v2, Lcom/adview/AdViewLayout$ViewAdRunnable;

    invoke-direct {v2, v0, p1}, Lcom/adview/AdViewLayout$ViewAdRunnable;-><init>(Lcom/adview/AdViewLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 80
    invoke-virtual {v0}, Lcom/adview/AdViewLayout;->rotateThreadedDelayed()V

    goto :goto_0
.end method

.method public handle()V
    .locals 5

    .prologue
    .line 26
    iget-object v4, p0, Lcom/adview/adapters/ZestADZAdapter;->adViewLayoutReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v4}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/adview/AdViewLayout;

    .line 27
    .local v2, adViewLayout:Lcom/adview/AdViewLayout;
    if-nez v2, :cond_1

    .line 52
    :cond_0
    :goto_0
    return-void

    .line 31
    :cond_1
    :try_start_0
    iget-object v4, p0, Lcom/adview/adapters/ZestADZAdapter;->ration:Lcom/adview/obj/Ration;

    iget-object v4, v4, Lcom/adview/obj/Ration;->key:Ljava/lang/String;

    invoke-static {v4}, Lcom/zestadz/android/AdManager;->setadclientId(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1

    .line 39
    :try_start_1
    iget-object v4, v2, Lcom/adview/AdViewLayout;->activityReference:Ljava/lang/ref/WeakReference;

    invoke-virtual {v4}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/Activity;

    .line 40
    .local v0, activity:Landroid/app/Activity;
    if-eqz v0, :cond_0

    .line 44
    new-instance v1, Lcom/zestadz/android/ZestADZAdView;

    invoke-direct {v1, v0}, Lcom/zestadz/android/ZestADZAdView;-><init>(Landroid/app/Activity;)V

    .line 45
    .local v1, adView:Lcom/zestadz/android/ZestADZAdView;
    invoke-virtual {v1, p0}, Lcom/zestadz/android/ZestADZAdView;->setListener(Lcom/zestadz/android/ZestADZAdView$ZestADZListener;)V

    .line 46
    invoke-virtual {v1}, Lcom/zestadz/android/ZestADZAdView;->displayAd()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 48
    .end local v0           #activity:Landroid/app/Activity;
    .end local v1           #adView:Lcom/zestadz/android/ZestADZAdView;
    :catch_0
    move-exception v4

    move-object v3, v4

    .line 49
    .local v3, e:Ljava/lang/Exception;
    invoke-virtual {v2}, Lcom/adview/AdViewLayout;->rollover()V

    goto :goto_0

    .line 34
    .end local v3           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v4

    move-object v3, v4

    .line 35
    .local v3, e:Ljava/lang/IllegalArgumentException;
    invoke-virtual {v2}, Lcom/adview/AdViewLayout;->rollover()V

    goto :goto_0
.end method
